package file;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class Demo7 {

    public static void main(String[] args) {
        try(InputStream inputStream=new FileInputStream("./text.txt")) {
            while (true){
                int b=inputStream.read();
                if(b==-1){
                    break;
                }
                System.out.println(b);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }











//    public static void main(String[] args) throws IOException {
//        InputStream inputStream = null;
//        try {
//            inputStream=new FileInputStream("./text.txt");
//            while (true){
//                int b=inputStream.read();
//                if(b==-1){
//                    break;
//                }
//                System.out.println(b);
//            }
//        } catch (IOException e) {
//            e.printStackTrace();
//        } finally {
//            inputStream.close();
//        }
//    }
}
